<?php

namespace App\Http\Controllers\Api\V1;

use App\Http\Controllers\Controller;
use App\Repository\CategoryRepository;

class CategoryController extends Controller
{
    public $category;

    /**
     * CategoryController constructor.
     * @param $category
     */
    public function __construct(CategoryRepository $category)
    {
        $this->category = $category;
    }

    /**
     * 获取所有分类数据
     * @return \Illuminate\Database\Eloquent\Collection|static[]
     */
    public function getAllCategories()
    {
        return $this->category->getAllCategories();
    }
}
